<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"> 
    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <h2>Orgão</h2>
            <h:form id="form" acceptcharset="utf-8">
                <p:growl id="msg" life="5000"/>
                <p:panel styleClass="container_24 clearfix "  style="background: none; border: none;" >

                    <p:menu  styleClass="grid_5">  
                        <p:submenu label="Orgão">  
                            <p:menuitem value="Novo" style="font-size: 13px;" actionListener="#{managerRedirect.redirect('createOrgan.xhtml')}"   update="@form" icon="ui-icon-circle-plus" />  
                            <p:menuitem value="Pesquisar" style="font-size: 13px;" actionListener="#{managerRedirect.redirect('searchOrgan.xhtml')}"   update="@form" icon="ui-icon-circle-zoomout" />  
                        </p:submenu>  
                    </p:menu>
                    <div class="grid_18">
                        <p class="subtitle" style="margin-top: -40px;">Recentes</p>
                        <p:dataTable value="#{managerSearchOrgan.lstOrgan()}" var="orgao"
                                     emptyMessage="Nenhum Orgão" style="width: 100%;"
                                     styleClass="dataTable">
                            <f:facet name="header">
                                <h:outputText value="Orgãos"/>
                            </f:facet>

                            <p:column headerText="Nome" style="font-size: 12px; width: 300px;">
                                <h:outputText value="#{orgao.name}" style="font-size: 12px;"/>
                            </p:column>

                            <p:column headerText="Vara" style="font-size: 12px; width: 300px;">
                                <h:outputText value="#{orgao.vara}" style="font-size: 12px;"/>
                            </p:column>

                            <p:column headerText="Cidade" style="font-size: 12px; width: 300px;">
                                <h:outputText value="#{orgao.city.name}" style="font-size: 12px;"/>
                            </p:column>
                            <p:column headerText="Opções" style="font-size: 12px; width: 50px;">
                                <p:commandButton icon="ui-icon-folder-collapsed" actionListener="#{managerEditOrgan.redirect('editOrgan.xhtml', orgao)}" title="Editar" />
                                <p:commandButton icon="ui-icon-circle-zoomin" actionListener="#{managerSearchOrgan.redirect('showOrgan.xhtml', orgao)}" title="Visualizar Orgão" />
                            </p:column>
                        </p:dataTable>
                    </div>

                </p:panel>
            </h:form>
        </ui:define>
    </ui:composition>
</html>